Class Objects.Moveable

Represents a moveable object in the game world.

Examples include the player, traps, enemies, doors, and pickups. See also Objects.LaraObject for player-specific features.

Functions

Moveable(objectID, name, position, [rotation], [roomNumber], [animNumber], [frameNumber], [hp], [OCB], [AIBits]) Used to generate a new moveable dynamically at runtime.
Moveable:GetObjectID() Retrieve the object ID from a moveable.
Moveable:SetObjectID(objectID) Change the moveable's object ID.
Moveable:GetName() Get the moveable's name (its unique string identifier).
Moveable:SetName(name) Set the moveable's name (its unique string identifier).
Moveable:GetPosition() Get the moveable's position.
Moveable:SetPosition(position, [updateRoom]) Set the moveable's position.
Moveable:GetJointPosition(jointIndex, [offset]) Get the moveable's joint position with an optional relative offset.
Moveable:GetJointRotation(index) Get the moveable's joint rotation.
Moveable:GetRotation() Get the moveable's rotation.
Moveable:GetJointOffset(jointIndex) Get the moveable's joint offset.
Moveable:SetJointOffset(jointIndex, offset) Set the moveable's joint offset.
Moveable:GetJointScale(jointIndex) Get the moveable's joint scale.
Moveable:SetJointScale(jointIndex, scale) Set the moveable's joint scale.
Moveable:GetAdditionalJointRotation(jointIndex) Get the moveable's additional joint rotation.
Moveable:SetAdditionalJointRotation(jointIndex, rotation) Set the moveable's additional joint rotation.
Moveable:SetRotation(rotation) Set the moveable's rotation.
Moveable:GetScale() Get the moveable's visual scale.
Moveable:SetScale(scale) Set the moveable's visual scale.
Moveable:GetHP() Get current HP (hit points / health points).
Moveable:SetHP(HP) Set current HP (hit points / health points).
Moveable:GetSlotHP() Get HP (hit points / health points) definded for that object ID.
Moveable:GetOCB() Get OCB (object code bit) of the moveable.
Moveable:SetOCB(OCB) Set OCB (object code bit) of the moveable.
Moveable:GetEffect() Get current moveable effect.
Moveable:SetEffect(effect, [timeout]) Set the effect for this moveable.
Moveable:SetCustomEffect(color1, color2, [timeout]) Set custom colored burn effect to moveable.
Moveable:GetItemFlags(index) Get the value stored in ItemFlags[index].
Moveable:SetItemFlags(value, index) Stores a value in ItemFlags[index].
Moveable:GetProperty(name) Get a property value.
Moveable:SetProperty(name, value) Set a property value.
Moveable:HasInstanceProperty(name) Check if a property value was individually set for a given moveable instance.
Moveable:GetColor() Get the moveable's color.
Moveable:SetColor(color) Set the moveable's color.
Moveable:GetAIBits() Get AIBits of a moveable.
Moveable:SetAIBits(bits) Set AIBits of a moveable.
Moveable:GetState() Retrieve the index of the current state.
Moveable:SetState(index) Set the moveable's state to the one specified by the given index.
Moveable:GetTargetState() Retrieve the index of the target state.
Moveable:GetAnimSlot() Retrieve the slot ID of the animation.
Moveable:GetAnim() Retrieve the index of the current animation.
Moveable:SetAnim(index, [slot], [blendFrames]) Set the moveable's animation to the one specified by the given index.
Moveable:GetFrame() Retrieve frame number.
Moveable:SetFrame(frame) Set frame number.
Moveable:GetVelocity() Get the moveable's velocity.
Moveable:SetVelocity(velocity) Set the moveable's velocity to specified value.
Moveable:GetEndFrame() Get the end frame number of the moveable's active animation.
Moveable:GetActive() Determine whether the moveable is active or not.
Moveable:GetHitStatus() Get the hit status of the moveable.
Moveable:GetRoom() Get the current room of the moveable.
Moveable:GetRoomNumber() Get the current room number of the moveable.
Moveable:SetRoomNumber(roomID) Set the room ID of a moveable.
Moveable:GetStatus() Get the moveable's status.
Moveable:SetStatus(status) Set the moveable's status.
Moveable:GetMeshCount() Get number of meshes for a particular moveable.
Moveable:GetMeshVisible(index) Get visibility state of a specified mesh of a moveable.
Moveable:SetMeshVisible(index, isVisible) Makes specified mesh visible or invisible.
Moveable:ShatterMesh(index) Shatters specified mesh and makes it invisible.
Moveable:GetMeshSwapped(index) Get state of specified mesh swap of a moveable.
Moveable:SwapMesh(index, objectID, [swapIndex]) Set state of specified mesh swap of a moveable.
Moveable:UnswapMesh(index) Unset specified mesh swap of a moveable.
Moveable:GetSkinnedMesh() Get the skinned mesh swap state of a moveable.
Moveable:SwapSkinnedMesh(objectID, [swapIndex]) Swap skinned mesh of a moveable.
Moveable:UnswapSkinnedMesh() Unset skinned mesh swap of a moveable.
Moveable:ClearSkinnedMesh() Clear skinned mesh of a moveable.
Moveable:Enable([timeout]) Enable the item, as if a trigger for it had been stepped on.
Moveable:Disable() Disable the item, as if an antitrigger for it had been stepped on.
Moveable:Explode() Explode this moveable.
Moveable:Shatter() Shatter this moveable.
Moveable:GetCollidable() Get the item's collision state.
Moveable:SetCollidable(collidable) Set the item's collision.
Moveable:GetVisible() Get the item's visibility state.
Moveable:SetVisible(visible) Set the item's visibility.
Moveable:GetValid() Test if the moveable is in a valid state.
Moveable:Destroy() Destroy the moveable.
Moveable:AttachObjCamera(mesh, target, targetMesh) Attach camera to the moveable's current position, and target another moveable.
Moveable:AnimFromObject(objectID, animNumber, stateID) Borrow animation from an object.
Moveable:ShowInteractionHighlight([interactionType]) Show interaction highlight for the object for current game frame.
Moveable:HideInteractionHighlight() Suppresses interaction highlight for the object for current game frame.
Moveable:SetOnHit(function) Sets the function to be called when the moveable is shot by Lara.
Moveable:SetOnKilled(function) Sets the function to be called when the moveable is destroyed or killed.
Moveable:SetOnLoop(function, [post]) Sets the function to be called during the moveable control loop.
Moveable:SetOnCollidedWithObject(function) Sets the function to be called when this moveable collides with another moveable.
Moveable:SetOnCollidedWithRoom(function) Sets the function to be called when this moveable collides with room geometry (e.g.


Functions

Moveable(objectID, name, position, [rotation], [roomNumber], [animNumber], [frameNumber], [hp], [OCB], [AIBits])
Used to generate a new moveable dynamically at runtime. For more information on each parameter, see the associated getters and setters. If you do not know what to set for these, most can just be ignored (see usage).

Parameters:

  • objectID ObjID Object ID.
  • name string Lua name.
  • position Vec3 Position in level.
  • rotation Rotation Rotation about x, y, and z axes. Optional.
  • roomNumber int The room number the moveable is in. Needed if you are dealing with overlapping rooms and need to force certain room number. Optional.
  • animNumber int Animation number. Optional.
  • frameNumber int Frame number. Optional.
  • hp int Hit points. Optional.
  • OCB int Object code bits. Optional.
  • AIBits table Table with six AI bits. Optional.

Returns:

    Moveable A new Moveable object.

Usage:

    local item = Moveable(
    	TEN.Objects.ObjID.PISTOLS_ITEM, -- object id
    	"test", -- name
    	Vec3(18907, 0, 21201)) -- position
Moveable:GetObjectID()
Retrieve the object ID from a moveable.

Returns:

    ObjID A number representing the object ID of the moveable.
Moveable:SetObjectID(objectID)
Change the moveable's object ID. This will literally change the moveable.

Parameters:

  • objectID ObjID The new ID.

Usage:

    shiva = TEN.Objects.GetMoveableByName("shiva_60")
    shiva:SetObjectID(TEN.Objects.ObjID.BIGMEDI_ITEM)
Moveable:GetName()
Get the moveable's name (its unique string identifier). This corresponds with the "Lua Name" field in a moveable's properties in Tomb Editor.

Returns:

    string The moveable's name.
Moveable:SetName(name)
Set the moveable's name (its unique string identifier). It cannot be blank and cannot share a name with any other existing moveable.

Parameters:

  • name string The new moveable's name.

Returns:

    bool true if name was successfully set, false otherwise (e.g. if another moveable has the name already).
Moveable:GetPosition()
Get the moveable's position.

Returns:

    Vec3 Moveable's position.
Moveable:SetPosition(position, [updateRoom])
Set the moveable's position.

Parameters:

  • position Vec3 The new position of the moveable.
  • updateRoom bool Will room changes be automatically detected? Set to false if you are using overlapping rooms. Default: true.
Moveable:GetJointPosition(jointIndex, [offset])
Get the moveable's joint position with an optional relative offset.

Parameters:

  • jointIndex int Index of a joint to get position.
  • offset Vec3 Offset relative to the joint. Optional.

Returns:

    Vec3 World position.
Moveable:GetJointRotation(index)
Get the moveable's joint rotation.

Parameters:

  • index int Index of a joint to get rotation.

Returns:

    Rotation Moveable's joint rotation.
Moveable:GetRotation()
Get the moveable's rotation.

Returns:

    Rotation Moveable's rotation.
Moveable:GetJointOffset(jointIndex)
Get the moveable's joint offset.

Parameters:

  • jointIndex int Index of a joint.

Returns:

    Vec3 Joint offset.
Moveable:SetJointOffset(jointIndex, offset)
Set the moveable's joint offset. This effect is visual only and does not affect collision.

Parameters:

  • jointIndex int Index of a joint.
  • offset Vec3 Joint offset to set.
Moveable:GetJointScale(jointIndex)
Get the moveable's joint scale.

Parameters:

  • jointIndex int Index of a joint.

Returns:

    Vec3 Joint scale.
Moveable:SetJointScale(jointIndex, scale)
Set the moveable's joint scale. This effect is visual only and does not affect collision.

Parameters:

  • jointIndex int Index of a joint.
  • scale Vec3 Joint scale to set.
Moveable:GetAdditionalJointRotation(jointIndex)
Get the moveable's additional joint rotation.

Parameters:

  • jointIndex int Index of a joint.

Returns:

    Rotation Additional joint rotation.
Moveable:SetAdditionalJointRotation(jointIndex, rotation)
Set the moveable's additional joint rotation. The rotation is added on top of the joint's base animation rotation. Set Rotation(0, 0, 0) to reset the joint rotation back to its default.

Parameters:

  • jointIndex int Index of a joint to rotate.
  • rotation Rotation Additional joint rotation to add.
Moveable:SetRotation(rotation)
Set the moveable's rotation.

Parameters:

  • rotation Rotation The moveable's new rotation.
Moveable:GetScale()
Get the moveable's visual scale.

Returns:

    Vec3 Moveable's visual scale.
Moveable:SetScale(scale)
Set the moveable's visual scale. Does not affect collision.

Parameters:

  • scale Vec3 New visual scale.
Moveable:GetHP()
Get current HP (hit points / health points).

Returns:

    int The amount of HP the moveable currently has.
Moveable:SetHP(HP)
Set current HP (hit points / health points). Clamped to [0, 32767] for "intelligent" entities (i.e. anything with AI); clamped to [-32767, 32767] otherwise.

Parameters:

  • HP int The amount of HP to give the moveable.
Moveable:GetSlotHP()
Get HP (hit points / health points) definded for that object ID.

Returns:

    int The moveable's slot default hit points.
Moveable:GetOCB()
Get OCB (object code bit) of the moveable.

Returns:

    int The moveable's current OCB value.
Moveable:SetOCB(OCB)
Set OCB (object code bit) of the moveable.

Parameters:

  • OCB int The new value for the moveable's OCB.
Moveable:GetEffect()
Get current moveable effect.

Returns:

    EffectID Effect type currently assigned.
Moveable:SetEffect(effect, [timeout])
Set the effect for this moveable.

Parameters:

  • effect EffectID Type of effect to assign.
  • timeout float Time (in seconds) after which effect turns off. Optional.
Moveable:SetCustomEffect(color1, color2, [timeout])
Set custom colored burn effect to moveable.

Parameters:

  • color1 Color The primary color of the effect (also used for lighting).
  • color2 Color The secondary color of the effect.
  • timeout float Time (in seconds) after which effect turns off. Optional.
Moveable:GetItemFlags(index)
Get the value stored in ItemFlags[index].

Parameters:

  • index int Index of the ItemFlag, can be between 0 and 7.

Returns:

    int The value contained in the ItemFlags[index].
Moveable:SetItemFlags(value, index)
Stores a value in ItemFlags[index].

Parameters:

  • value short Value to store in the moveable's ItemFlags[index].
  • index int Index of the ItemFlag where to store the value.
Moveable:GetProperty(name)
Get a property value. Tries to get an instance property first, then falls back to global object ID property. Returns nil if the property does not exist.

Parameters:

  • name string The property name.

Returns:

    any The property value, or nil if not set. You can use Type module functions to determine return value type.
Moveable:SetProperty(name, value)
Set a property value. Will be set only for this moveable instance. If property does not exist, creates it. If value is nil, the instance property is removed. Does not affect global object ID property set by Objects.SetMoveableProperty.

Parameters:

Moveable:HasInstanceProperty(name)
Check if a property value was individually set for a given moveable instance.

Parameters:

  • name string The property name.

Returns:

    bool True if an instance property exists.
Moveable:GetColor()
Get the moveable's color.

Returns:

    Color Moveable's color.
Moveable:SetColor(color)
Set the moveable's color.

Parameters:

  • color Color The new color of the moveable.
Moveable:GetAIBits()

Get AIBits of a moveable. This will return a table with six values, each corresponding to an active behaviour. If the moveable is in a certain AI mode, the table will have a 1 in the corresponding cell. Otherwise, the cell will hold a 0.

1 - Guard
2 - Ambush
3 - Patrol 1
4 - Modify
5 - Follow
6 - Patrol 2

Returns:

    table A table of AI bits.
Moveable:SetAIBits(bits)
Set AIBits of a moveable. Use this to force a moveable into a certain AI mode or modes, as if a certain nullmesh (or more than one) had suddenly spawned beneath their feet.

Parameters:

  • bits table A table of AI bits.

Usage:

    local sas = TEN.Objects.GetMoveableByName("sas_enemy")
    sas:SetAIBits({1, 0, 0, 0, 0, 0})
Moveable:GetState()
Retrieve the index of the current state. This corresponds to the number shown in the item's state ID field in WadTool.

Returns:

    int The index of the active state.
Moveable:SetState(index)
Set the moveable's state to the one specified by the given index. Performs no bounds checking. Ensure the number given is correct, else moveable may end up in corrupted animation state.

Parameters:

  • index int The index of the desired state.
Moveable:GetTargetState()
Retrieve the index of the target state. This corresponds to the state the moveable is trying to get into, which is sometimes different from the active state.

Returns:

    int The index of the target state.
Moveable:GetAnimSlot()
Retrieve the slot ID of the animation. In certain cases, moveable may play animations from another object slot. Use this function when you need to identify such cases.

Returns:

    int Animation slot ID.
Moveable:GetAnim()
Retrieve the index of the current animation. This corresponds to the number shown in the item's animation list in WadTool.

Returns:

    int The index of the active animation.
Moveable:SetAnim(index, [slot], [blendFrames])
Set the moveable's animation to the one specified by the given index. Performs no bounds checking. Ensure the number given is correct, else moveable may end up in corrupted animation state.

Parameters:

  • index int Index of the desired animation.
  • slot int Slot ID of the desired animation. If omitted, the moveable's own slot ID is used. Optional.
  • blendFrames int Number of frames to blend between current and new animation. If omitted, no blending will be performed. Optional.
Moveable:GetFrame()
Retrieve frame number. This is the current frame of the moveable's active animation.

Returns:

    int The current frame of the active animation.
Moveable:SetFrame(frame)
Set frame number. This will move the animation to the given frame. The number of frames in an animation can be seen under the heading "End frame" in the WadTool animation editor. If the animation has no frames, the only valid argument is -1.

Parameters:

  • frame int The new frame number.
Moveable:GetVelocity()
Get the moveable's velocity. In most cases, only Z and Y components are used as forward and vertical velocity. In some cases, primarily NPCs, X component is used as side velocity.

Returns:

    Vec3 Current moveable velocity.
Moveable:SetVelocity(velocity)
Set the moveable's velocity to specified value. In most cases, only Z and Y components are used as forward and vertical velocity. In some cases, primarily NPCs, X component is used as side velocity.

Parameters:

  • velocity Vec3 Velocity represented as vector.
Moveable:GetEndFrame()
Get the end frame number of the moveable's active animation. This is the "End Frame" set in WADTool for the animation.()

Returns:

    int End frame number of the active animation.
Moveable:GetActive()
Determine whether the moveable is active or not.

Returns:

    bool True if the moveable is active.
Moveable:GetHitStatus()
Get the hit status of the moveable.

Returns:

    bool true if the moveable was hit by something in the last gameplay frame, false otherwise.
Moveable:GetRoom()
Get the current room of the moveable.

Returns:

    Room Current room of the moveable.
Moveable:GetRoomNumber()
Get the current room number of the moveable.

Returns:

    int Number representing the current room of the moveable.
Moveable:SetRoomNumber(roomID)
Set the room ID of a moveable. Use this if not using SetPosition's automatic room update - for example, when dealing with overlapping rooms.

Parameters:

  • roomID int New room's ID.

Usage:

    local sas = TEN.Objects.GetMoveableByName("sas_enemy")
    sas:SetRoomNumber(newRoomID)
    sas:SetPosition(newPos, false)
Moveable:GetStatus()
Get the moveable's status.

Returns:

    MoveableStatus Status.
Moveable:SetStatus(status)
Set the moveable's status.

Parameters:

Moveable:GetMeshCount()
Get number of meshes for a particular moveable. Returns number of meshes in an object.

Returns:

    int Number of meshes.
Moveable:GetMeshVisible(index)
Get visibility state of a specified mesh of a moveable. Returns true if specified mesh is visible on a moveable, and false if it is not visible.

Parameters:

  • index int Index of a mesh.

Returns:

    bool Visibility status.
Moveable:SetMeshVisible(index, isVisible)
Makes specified mesh visible or invisible. Use this to show or hide a specified mesh of a moveable.

Parameters:

  • index int Index of a mesh.
  • isVisible bool true if you want the mesh to be visible, false otherwise.
Moveable:ShatterMesh(index)
Shatters specified mesh and makes it invisible. Note that you can re-enable mesh later by using SetMeshVisible().

Parameters:

  • index int Index of a mesh to shatter.
Moveable:GetMeshSwapped(index)
Get state of specified mesh swap of a moveable. Returns true if specified mesh is swapped on a moveable, and false if it is not swapped. Also returns the object slot ID the mesh was swapped from, or nil if no swap is active.

Parameters:

  • index int Index of a mesh.

Returns:

  1. bool Mesh swap status.
  2. ObjID Object slot ID the mesh was swapped from. Nil if not swapped.
Moveable:SwapMesh(index, objectID, [swapIndex])
Set state of specified mesh swap of a moveable. Use this to swap specified mesh of a moveable.

Parameters:

  • index int Index of a mesh.
  • objectID int ID of a slot to get meshswap from.
  • swapIndex int Index of a mesh from meshswap slot to use. In WadTool, you have to set vertex weights for this mesh according to original mesh index to avoid rendering issues. Optional.
Moveable:UnswapMesh(index)
Unset specified mesh swap of a moveable. Use this to bring back original unswapped mesh.

Parameters:

  • index int Index of a mesh to unswap.
Moveable:GetSkinnedMesh()
Get the skinned mesh swap state of a moveable. Returns the object slot ID and optional swap index of the currently active skinned mesh.

Returns:

  1. ObjID Object slot ID of the active skinned mesh. Nil if no swap is active.
  2. int Swap index within the slot. Nil if using the slot's default skinned mesh.
Moveable:SwapSkinnedMesh(objectID, [swapIndex])
Swap skinned mesh of a moveable. Use this to replace one skinned mesh with another.

Parameters:

  • objectID int ID of a slot to get skinned meshswap from.
  • swapIndex int If set, swaps skinned mesh with bone mesh with a specified index. Use if you have several skinned meshes (e.g. outfits) in a single slot. Optional.
Moveable:UnswapSkinnedMesh()
Unset skinned mesh swap of a moveable. Use this to bring back original unswapped skinned mesh.
Moveable:ClearSkinnedMesh()
Clear skinned mesh of a moveable.
Moveable:Enable([timeout])
Enable the item, as if a trigger for it had been stepped on.

Parameters:

  • timeout float Time (in seconds) after which moveable automatically disables. Optional.
Moveable:Disable()
Disable the item, as if an antitrigger for it had been stepped on. For example, it will close an open door or extinguish a flame emitter. Note that this will not trigger an OnKilled callback.
Moveable:Explode()
Explode this moveable. Also kills and disables it.
Moveable:Shatter()
Shatter this moveable. Also kills and disables it.
Moveable:GetCollidable()
Get the item's collision state.

Returns:

    bool Item's collision state.
Moveable:SetCollidable(collidable)
Set the item's collision.

Parameters:

  • collidable bool true if the caller should be collidable, false if no collision should occur.
Moveable:GetVisible()
Get the item's visibility state.

Returns:

    bool Item's visibility state.
Moveable:SetVisible(visible)
Set the item's visibility. An invisible item will have collision turned off, as if it no longer exists in the game world.

Parameters:

  • visible bool true if the caller should become visible, false if it should become invisible.
Moveable:GetValid()
Test if the moveable is in a valid state. Indicates that it has not been destroyed through Lua or killed by Lara.

Returns:

    bool true if the moveable is still not destroyed.
Moveable:Destroy()
Destroy the moveable. This will mean it can no longer be used, except to re-initialize it with another moveable.
Moveable:AttachObjCamera(mesh, target, targetMesh)
Attach camera to the moveable's current position, and target another moveable. The camera's position and target position will be maintained until this function is called again. Use View.ResetObjCamera to restore the regular camera.

Parameters:

  • mesh int Mesh of the moveable to which the camera will be attached.
  • target Moveable Moveable to target.
  • targetMesh int Mesh of the moveable to target.
Moveable:AnimFromObject(objectID, animNumber, stateID)
Borrow animation from an object.

Parameters:

  • objectID ObjID Object ID to take animation and state ID from.
  • animNumber int Animation from object.
  • stateID int State from object.
Moveable:ShowInteractionHighlight([interactionType])
Show interaction highlight for the object for current game frame. Can be useful if you have scripted an interaction with it.

Parameters:

Moveable:HideInteractionHighlight()
Suppresses interaction highlight for the object for current game frame. Can be useful when you need to manually block interaction highlight for a particular object or in a particular area.
Moveable:SetOnHit(function)
Sets the function to be called when the moveable is shot by Lara. Note that this will be triggered twice when shot with both pistols at once.

Parameters:

  • function function Callback function in LevelFuncs hierarchy to call when moveable is shot.
Moveable:SetOnKilled(function)
Sets the function to be called when the moveable is destroyed or killed. Note that enemy death often occurs at the end of an animation, and not at the exact moment the enemy's HP becomes zero.

Parameters:

  • function function Callback function in LevelFuncs hierarchy to call when moveable is killed.

Usage:

    LevelFuncs.baddyKilled = function(theBaddy) print("You killed a baddy!") end
    baddy:SetOnKilled(LevelFuncs.baddyKilled)
Moveable:SetOnLoop(function, [post])
Sets the function to be called during the moveable control loop. This callback runs on the fixed-timestep game loop either before or after the moveable's hardcoded control routine. Will be called only if moveable is active.

Parameters:

  • function function Callback function in LevelFuncs hierarchy to call during moveable update.
  • post bool If true, run after hardcoded control; otherwise run before it. Default: false.

Usage:

    LevelFuncs.preBaddyLoop = function(baddy)
        print("Pre-loop callback for " .. baddy:GetName())
    end
    
    LevelFuncs.postBaddyLoop = function(baddy)
        print("Post-loop callback for " .. baddy:GetName())
    end
    
    baddy:SetOnLoop(LevelFuncs.preBaddyLoop)
    baddy:SetOnLoop(LevelFuncs.postBaddyLoop, true)
Moveable:SetOnCollidedWithObject(function)
Sets the function to be called when this moveable collides with another moveable.

Parameters:

  • function function Callback function to be called (must be in LevelFuncs hierarchy). This function can take two arguments; these will store the two Moveables taking part in the collision.

Usage:

    -- obj1 is the collision moveable
    -- obj2 is the collider moveable
    
    LevelFuncs.objCollided = function(obj1, obj2)
        print(obj1:GetName() .. " collided with " .. obj2:GetName())
    end
    baddy:SetOnCollidedWithObject(LevelFuncs.objCollided)
Moveable:SetOnCollidedWithRoom(function)
Sets the function to be called when this moveable collides with room geometry (e.g. a wall or floor). This function can take an argument that holds the Moveable that collided with geometry.

Parameters:

  • function function Callback function to be called (must be in LevelFuncs hierarchy).

Usage:

    LevelFuncs.roomCollided = function(obj)
        print(obj:GetName() .. " collided with room geometry")
    end
    baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)
generated by TEN-LDoc (a fork of LDoc 1.4.6)